var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, i) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var i in t)
              Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
          })(t, i);
      };
      return function (t, i) {
        function a() {
          this.constructor = t;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        e(t, i),
          (t.prototype =
            null === i
              ? Object.create(i)
              : ((a.prototype = i.prototype), new a()));
      };
    })(),
  HTMLIframeElement = Laya.HTMLIframeElement,
  Tab = Laya.Tab,
  GameMainView = (function (e) {
    function t(t, i) {
      var a = e.call(this) || this;
      (a.isAutoFight = !1),
        (a.totalMsgArray = []),
        (a.privateArray = []),
        (a.isRunning = !1),
        (a.onLoadSystemMessageDataFn = {
          caller: a,
          code: 10,
          method: function (e) {
            var t = !1,
              i = !1,
              o = !1,
              s = !1;
            if ("1" == e.state) {
              for (n = 0; n < a.totalMsgArray.length; n++) {
                (l = a.totalMsgArray[n].state) != e.state || (t = !0);
              }
              0 == t && a.totalMsgArray.push(e);
            } else if ("2" == e.state)
              if (PrivateChatDialog.chatState)
                WebSocketService.send({ c: 1033, d: { roleid: e.info_id } });
              else {
                for (n = 0; n < a.totalMsgArray.length; n++) {
                  a.totalMsgArray[n].info_id != e.info_id || (o = !0);
                }
                0 == o && a.privateArray.push(e),
                  1 == a.privateArray.length &&
                    0 == o &&
                    a.totalMsgArray.push(e);
              }
            else if ("3" == e.state) {
              for (n = 0; n < a.totalMsgArray.length; n++) {
                (l = a.totalMsgArray[n].state) != e.state || (i = !0);
              }
              0 == i && a.totalMsgArray.push(e);
            } else if ("5" == e.state);
            else if ("6" == e.state) {
              for (var n = 0; n < a.totalMsgArray.length; n++) {
                var l = a.totalMsgArray[n].state;
                if (l == e.state) {
                  s = !0;
                  break;
                }
              }
              0 == s && a.totalMsgArray.push(e);
            } else
              "7" == e.state &&
                WebSocketService.send({ c: 4210, d: { pageNum: 0 } });
            a.showSystemMessage(a.totalMsgArray);
          },
        }),
        (a.HomeDiagoListener = {
          caller: a,
          code: 200,
          method: function (e) {
            var t = [],
              i = e.npclist;
            i.length, (a.diaListArr = e.npclist);
            for (var o, s = 0; s < i.length; s++)
              (o = {
                id: i[s].id,
                name: i[s].name,
                typeId: i[s].typeId,
                baseNavLabel: { text: i[s].name },
              }),
                t.push(o),
                "副本使者" == i[s].name && ((Global.isFuBen = !0), "副本使者");
          },
        }),
        (a.homeSuboardinateInfoListener = {
          caller: a,
          code: 320,
          method: function (e) {
            (a.image_fujiang_one.skin = ""),
              (a.image_fujiang_two.skin = ""),
              (a.image_fujiang_three.skin = "");
            for (var t = e.list.length, i = 0; i < t; i++) {
              var o = e.list[i].headImg;
              0 == i
                ? (a.image_fujiang_one.skin = "comp/fujiang/head_" + o + ".png")
                : 1 == i
                ? (a.image_fujiang_two.skin = "comp/fujiang/head_" + o + ".png")
                : 2 == i &&
                  (a.image_fujiang_three.skin =
                    "comp/fujiang/head_" + o + ".png");
            }
          },
        }),
        (a.onLoadPushMessageDataFn = {
          caller: a,
          code: 91,
          method: function (e) {
            FriendSeekDialog.showApplyMsgDialog(e.data);
          },
        }),
        (a.name = "GameMainView"),
        (a.roleId = t),
        (a.isOldeVersion = i),
        (Global.isOldeVersion = i);
      var o = [{ url: "res/atlas/map.atlas", type: Laya.Loader.ATLAS }];
      Laya.loader.load(
        o,
        Laya.Handler.create(a, a.onTabMainSelect),
        Laya.Handler.create(
          AXProgressBarView,
          AXProgressBarView.onLoadedRecourse,
          null,
          !1
        )
      );
      var s = AXTabBarItemView.openTabbarView();
      return (
        s.pos(0, Laya.stage.height - 63),
        a.addChild(s),
        (s.zOrder = 1100),
        (a.tab_middle_item.visible = !1),
        (a.tab_gameMain.selectHandler = new Laya.Handler(a, a.onGameMainTabFn)),
        Laya.stage.on("GameMainView", a, a.eventHandler),
        a.btn_xinshoulibao1.on(Laya.Event.CLICK, a, a.onGetXinShouLiBaoAction),
        a.btn_npc_open.on(Laya.Event.CLICK, a, a.onDidClickNpcTaskListOpenFn),
        a.label_tili.on(Laya.Event.CLICK, a, a.onDidClickTiLiZhiAction),
        a.btn_dabipin.on(
          Laya.Event.CLICK,
          a,
          a.onDidClickHuoDongDaBiPingAction
        ),
        (a.list_task_tip_board.vScrollBarSkin = ""),
        (a.list_task_tip_board.selectEnable = !0),
        a.list_task_tip_board.on(Laya.Event.CLICK, a, a.onTaskTipBoardData),
        (a.list_system_message.selectEnable = !0),
        a.list_system_message.on(
          Laya.Event.CLICK,
          a,
          a.onMessageDidClickAction
        ),
        WebSocketService.addListener({
          caller: a,
          code: 1e4,
          method: a.synReq,
        }),
        WebSocketService.addListener({
          caller: a,
          code: 100,
          method: a.onLoadHomeInfoListener,
        }),
        WebSocketService.addListener({
          caller: a,
          code: 300,
          method: a.baseInfoListener,
        }),
        WebSocketService.addListener(a.HomeDiagoListener),
        WebSocketService.addListener(a.homeSuboardinateInfoListener),
        WebSocketService.addListener(a.onLoadSystemMessageDataFn),
        WebSocketService.addListener(a.onLoadPushMessageDataFn),
        WebSocketService.addListener(
          { caller: a, code: 500, method: a.startFight },
          !0
        ),
        WebSocketService.addListener({
          caller: a,
          code: 713,
          method: a.onLoadNPCDialogData,
        }),
        WebSocketService.addListener({
          caller: a,
          code: 1451,
          method: a.onLoadMySelfMoney,
        }),
        WebSocketService.addListener(
          { caller: a, code: 1153, method: a.onLoadTaskListDetailData },
          !0
        ),
        WebSocketService.addListener(
          { caller: a, code: 1436, method: a.gotoDestination },
          !0
        ),
        WebSocketService.addListener(
          { caller: a, code: 1437, method: a.gotoDestination },
          !0
        ),
        WebSocketService.addListener({
          caller: a,
          code: 1425,
          method: a.onLoadXinShouLiBaoFn,
        }),
        WebSocketService.addListener({
          caller: a,
          code: 6067,
          method: a.onLoadNewRoleUseAction,
        }),
        WebSocketService.addListener({
          caller: a,
          code: 1904,
          method: a.onLoadUserTaoWaDataFn,
        }),
        WebSocketService.addListener({
          caller: a,
          code: 4210,
          method: a.onLoadGroupTeamDataFn,
        }),
        WebSocketService.addListener({
          caller: a,
          code: 5326,
          method: a.onLoadWeekNoticeData,
        }),
        a.initGameMainView(),
        a
      );
    }
    return (
      __extends(t, e),
      (t.prototype.initGameMainView = function () {
        WebSocketService.send({ c: 5, d: { roleId: this.roleId } }),
          this.isOldeVersion ||
            (WebSocketService.send({ c: 300 }),
            WebSocketService.send({ c: 1153, d: { mid: 0 } })),
          WebSocketService.send({ c: 320 }),
          WebSocketService.send({ c: 1425, d: { pageNum: 0 } }),
          WebSocketService.send({ c: 4210, d: { pageNum: 0 } }),
          WebSocketService.send({ c: 1800 }),
          (Global.isShowMarquee = !0),
          WebSocketService.send({ c: 200 }),
          WebSocketService.send({ c: 5326, d: { roleId: this.roleId } }),
          this.sycSite(),
          Laya.timer.loop(4e4, this, this.sycSite),
          (this.btn_xinshoulibao1.visible = !1),
          (this.image_xinshoulibao1.visible = !1),
          (this.list_system_message.visible = !1),
          (this.btn_dabipin.visible = !0),
          this.myselfInfo.on(Laya.Event.CLICK, this, this.onMyselfInfoFn),
          this.image_fujiang_one.on(
            Laya.Event.CLICK,
            this,
            this.onLoadImageFuJiangAction
          ),
          this.btn_map_item.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickMoveMapAction
          ),
          this.image_fujiang_two.on(
            Laya.Event.CLICK,
            this,
            this.onLoadImageFuJiangAction
          ),
          this.image_fujiang_three.on(
            Laya.Event.CLICK,
            this,
            this.onLoadImageFuJiangAction
          ),
          this.image_yiguan_item.on(
            Laya.Event.CLICK,
            this,
            this.onBaseSetSelect3
          ),
          this.btn_jishi_item.on(Laya.Event.CLICK, this, this.onBaseSetSelect4),
          this.btn_guangchang_item.on(
            Laya.Event.CLICK,
            this,
            this.onBaseSetSelect5
          ),
          this.btn_yiguan.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickYiGuanAction
          ),
          this.btn_leitai_item.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickLeiTaiAction
          ),
          this.btn_zhanchang_item.on(
            Laya.Event.CLICK,
            this,
            this.onLoadZhanChangAction
          );
      }),
      (t.prototype.onMessageDidClickAction = function (e) {
        if ("" != e.target.name) {
          var t = this.list_system_message.selectedIndex,
            i = this.totalMsgArray[t].state;
          if (3 == i)
            this.totalMsgArray.splice(t, 1),
              EmailMainControllerView.openEmailView();
          else if (2 == i) {
            t = t - 1 > 0 ? t : 0;
            var a = this.privateArray[t].info_id;
            this.privateArray.length > 1
              ? this.privateArray.splice(t, 1)
              : (1 == this.privateArray.length &&
                  this.privateArray.splice(t, 1),
                this.totalMsgArray.splice(
                  this.list_system_message.selectedIndex,
                  1
                ));
            var o = { id: a };
            PrivateChatDialog.showPrivateMsgDialog(o);
          } else if (1 == i) {
            this.totalMsgArray.splice(t, 1);
            ((s = MessageViewController.openView()).y = 70),
              Laya.stage.addChild(s);
          } else if (6 == i) {
            this.totalMsgArray.splice(t, 1);
            var s = TeamMessageController.openView();
            (s.y = 35), Laya.stage.addChild(s);
          }
          this.showSystemMessage(this.totalMsgArray);
        }
      }),
      (t.prototype.showSystemMessage = function (e, t) {
        var i = e;
        i.length > 0 && (this.list_system_message.visible = !0),
          (this.dataSource = []);
        for (var a, o = 0; o < i.length; o++)
          (a = {
            image_message_tip: { skin: this.dealSystemMessageState(i[o]) },
            state: i[o].state,
            info_id: i[o].info_id,
          }),
            this.dataSource.push(a);
        1 == this.dataSource.length
          ? (this.list_system_message.x = 307)
          : 2 == this.dataSource.length
          ? (this.list_system_message.x = 270)
          : 3 == this.dataSource.length
          ? (this.list_system_message.x = 237)
          : 4 == this.dataSource.length && (this.list_system_message.x = 200),
          (this.list_system_message.dataSource = this.dataSource);
      }),
      (t.prototype.dealSystemMessageState = function (e) {
        return 1 == e.state
          ? "comp/Home/image_message_system.png"
          : 2 == e.state
          ? "comp/Home/image_message_mychat.png"
          : 3 == e.state
          ? "comp/Home/image_message_email.png"
          : 6 == e.state
          ? "comp/Home/image_message_system.png"
          : (e.state, "comp/Home/image_message_system.png");
      }),
      (t.prototype.sycSite = function () {
        WebSocketService.send({ c: 100 });
      }),
      (t.prototype.onLoadZhanChangAction = function () {
        var e = battlefield.showBattleView();
        e.pos(0, 70), Laya.stage.addChild(e);
      }),
      (t.prototype.onDidClickMoveMapAction = function () {
        MoveMapPageDialog.showMoveMapDialog(),
          this.npcTaskListView && this.npcTaskListView.onClickNpcListData();
      }),
      (t.prototype.onDidClickLeiTaiAction = function () {
        var e = new AXChallengeBattleView();
        e.pos(0, 70), Laya.stage.addChild(e);
      }),
      (t.prototype.onDidClickYiGuanAction = function () {
        var e = MedicalView.openMedicalView();
        e.pos(0, 70), Laya.stage.addChild(e);
      }),
      (t.prototype.onBaseSetSelect3 = function (e) {
        var t = AXHouseRoom.openHouseView();
        (t.y = 70), Laya.stage.addChild(t);
      }),
      (t.prototype.onBaseSetSelect4 = function (e) {
        var t = AXMarketView.openMarketView();
        (t.y = 70), Laya.stage.addChild(t);
      }),
      (t.prototype.onBaseSetSelect5 = function (e) {
        var t = AXSquareView.openView();
        (t.y = 70), Laya.stage.addChild(t);
      }),
      (t.prototype.onLoadImageFuJiangAction = function (e) {
        var t = AXSubordinateView.openView();
        t.pos(0, 70), Laya.stage.addChild(t);
      }),
      (t.prototype.onMyselfInfoFn = function () {
        var e = UserInfoView.openView();
        e.pos(0, 35), Laya.stage.addChild(e);
      }),
      (t.prototype.onMyselfInfoFn1 = function () {
        NPCDataListDialog.showNpcListDialog();
      }),
      (t.prototype.synReq = function (e) {
        WebSocketService.send(e.data);
      }),
      (t.prototype.onTabMainSelect = function (e) {}),
      (t.prototype.reset = function () {
        this.isOldeVersion
          ? ((this.homepage = HomePageView.open(this.roleId)),
            Laya.stage.addChild(this.homepage),
            (this.tab_middle_item.visible = !0),
            (this.btn_leitai_item.visible = !1),
            (this.btn_npc_open.visible = !1),
            (this.list_task_tip_board.visible = !1),
            (this.btn_jishi_item.visible = !1),
            (this.btn_yiguan.visible = !1))
          : ((this.btn_leitai_item.visible = !0),
            (this.btn_jishi_item.visible = !0),
            (this.btn_yiguan.visible = !0),
            this.homepage && this.homepage.removeSelf()),
          (this.tab_gameMain.selectedIndex = 0),
          this.showChatRoomList();
      }),
      (t.prototype.managerVersion = function (e) {}),
      (t.prototype.onGetXinShouLiBaoAction = function () {
        "396" == this.canUseLiBaoID
          ? WebSocketService.send({ c: 6067 })
          : WebSocketService.send({ c: 1904, d: { gid: this.canUseLiBaoID } }),
          (this.btn_xinshoulibao1.visible = !1),
          (this.image_xinshoulibao1.visible = !1),
          Laya.stage.event("GameMainView", "refreshMoney");
      }),
      (t.prototype.onLoadTaskListDetailData = function (e) {
        e.code, e.data.yq || (e.data.yq = "");
        var t = e.data.yq.split("("),
          i = "";
        t.length > 1 && (i = "（" + t[1]), (this.taskArr = []);
        var a = {};
        (a = {
          task_name: { text: e.data.name + i },
          task_name_detail: { text: e.data.ts },
          site: e.data.site,
        }),
          this.taskArr.push(a),
          (this.list_task_tip_board.dataSource = this.taskArr);
      }),
      (t.prototype.onLoadXinShouLiBaoFn = function (e) {
        if (!Global.isOldeVersion && 0 == e.code)
          for (var t = e.data, i = 0; i < t.length; i++) {
            var a = t[i];
            (this.canUseLiBaoID = a.id),
              this.dealLiBaoImage(a.id),
              Global.roleLvl >= 50
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id &&
                    505 != a.id &&
                    506 != a.id &&
                    507 != a.id &&
                    508 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 40
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id &&
                    505 != a.id &&
                    506 != a.id &&
                    507 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 30
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id &&
                    505 != a.id &&
                    506 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 20
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id &&
                    505 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 15
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 10
                ? (396 != a.id && 501 != a.id && 502 != a.id && 503 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 5
                ? (396 != a.id && 501 != a.id && 502 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 1 &&
                  ((396 != a.id && 501 != a.id) || this.isShowXinShouLiBao());
          }
      }),
      (t.prototype.isShowXinShouLiBao = function () {
        Global.isOldeVersion ||
          ((this.btn_xinshoulibao1.visible = !0),
          (this.image_xinshoulibao1.visible = !0));
      }),
      (t.prototype.dealLiBaoImage = function (e) {
        this.image_xinshoulibao1.skin =
          396 == e
            ? "comp/image_xinshoulibao.png"
            : "comp/image_xinshoulibao_dawa.png";
      }),
      (t.prototype.onTaskTipBoardData = function (e) {
        "" != e.target.name &&
          "btn_hit_task" == e.target.name &&
          (this.taskArr && this.taskArr.length > 0
            ? ((this.taskDict =
                this.taskArr[this.list_task_tip_board.selectedIndex]),
              this.taskDict &&
                this.taskDict.site > 0 &&
                WebSocketService.send({
                  c: 1437,
                  d: { siteId: this.taskDict.site },
                }))
            : (this.list_task_tip_board.dataSource = [""]));
      }),
      (t.prototype.gotoDestination = function (e) {
        1436 == e.act_id
          ? this.taskDict.site &&
            WebSocketService.send({
              c: 1437,
              d: { siteId: this.taskDict.site },
            })
          : 0 == e.code
          ? (ToastView.toastView("已到达目的地"),
            Laya.stage.event("GameMainView", "person"))
          : ToastView.toastView(e.msg);
      }),
      (t.prototype.onGameMainTabFn = function (e, t) {
        0 == this.tab_gameMain.selectedIndex
          ? (this.homepage && this.homepage.setupPersonTabView(),
            (this.clip_item0.index = 4),
            (this.clip_item1.index = 1),
            (this.clip_item2.index = 2),
            (this.clip_item3.index = 3))
          : 1 == this.tab_gameMain.selectedIndex
          ? (this.homepage && this.homepage.setupfacilityTabView(!1),
            (this.clip_item1.index = 5),
            (this.clip_item0.index = 0),
            (this.clip_item2.index = 2),
            (this.clip_item3.index = 3))
          : 2 == this.tab_gameMain.selectedIndex
          ? (this.homepage && this.homepage.setupMapTabView(),
            (this.clip_item2.index = 6),
            (this.clip_item0.index = 0),
            (this.clip_item1.index = 1),
            (this.clip_item3.index = 3))
          : 3 == this.tab_gameMain.selectedIndex &&
            (this.homepage && this.homepage.setupFeatureTabView(),
            (this.clip_item3.index = 7),
            (this.clip_item0.index = 0),
            (this.clip_item1.index = 1),
            (this.clip_item2.index = 2));
      }),
      (t.prototype.showChatRoomList = function () {
        (this.chatList = ChatRoomView.openRoomView()),
          (this.chatList.y = 460),
          this.chatList.initChatUI(),
          Laya.stage.addChild(this.chatList);
      }),
      (t.prototype.eventHandler = function (e) {
        e &&
          ("close" == e.code &&
            (this.removeSelf(), this.homepage && this.homepage.removeSelf()),
          "person" == e &&
            ((this.tab_gameMain.selectedIndex = 0),
            this.onGameMainTabFn(0, null)),
          "loadingFuben_MainTab" == e &&
            ((this.tab_gameMain.selectedIndex = 0),
            this.onGameMainTabFn(0, null)),
          "setAutoFight" == e.code && (this.isAutoFight = e.isAuto),
          "startRequestFight" == e.code &&
            e.data &&
            ((this.npcObj = e.data), this.requestFight()),
          "refreshMoney" == e && WebSocketService.send({ c: 1451 }),
          "start_fight_npc" == e &&
            ((this.isAutoFight = !1), this.requestFight()),
          "start_fightnpc_from_homepage" == e.code &&
            e.data &&
            ((this.isAutoFight = !1),
            (this.npcObj = e.data),
            this.requestFight()),
          "update_task_view" == e
            ? WebSocketService.send({ c: 1153, d: { mid: 0 } })
            : "npc" == e
            ? WebSocketService.send({ c: 200 })
            : "exp" == e || "hp" == e
            ? WebSocketService.send({ c: 300 })
            : "username" == e.code && e.data
            ? (this.nickName.text = e.data)
            : "cortege" == e && WebSocketService.send({ c: 320 }));
      }),
      (t.prototype.requestFight = function () {
        this.isRunning ||
          ((this.isRunning = !0),
          null == this.bout
            ? Laya.loader.load(
                ["fight/bg_1.png", "fight/bg.png"],
                Handler.create(this, this.requestFightHandler),
                Handler.create(
                  AXProgressBarView,
                  AXProgressBarView.onLoadedRecourse,
                  null,
                  !1
                )
              )
            : this.requestFightHandler());
      }),
      (t.prototype.requestFightHandler = function () {
        (this.isRunning = !1),
          AXProgressBarView.onLoadedRecourse(0),
          WebSocketService.send({ c: 500, d: { npcId: this.npcObj.id } });
      }),
      (t.prototype.startFight = function (e) {
        if (e.code || !e.fRInfos)
          return (
            AXProgressBarView.onLoadedRecourse(1),
            ToastView.toastView(e.msg),
            (this.isAutoFight = e.isAuto),
            void localStorage.setItem("startAuto", "")
          );
        CommunicateDialog.staticClose();
        var t;
        if (
          (null != this.bout
            ? (t = this.bout)
            : ((t = new Fight.BoutFight(375)), (this.bout = t), t.bind()),
          t.init(375, e),
          t.payAll(),
          this.isAutoFight)
        ) {
          var i = localStorage.getItem("autofightTime"),
            a = parseInt(i) - 1;
          localStorage.setItem("autofightTime", a + "");
          var o = new Date(),
            s = o.getFullYear() + "-" + (o.getMonth() + 1) + "-" + o.getDate(),
            n = "autofightTimeTotal:" + Global.roleId + ":" + s,
            l = parseInt(localStorage.getItem(n));
          l >= 0 || (l = 0),
            localStorage.setItem(n, l + 1 + ""),
            t.startMakeWithAuto(a);
        } else t.startMake();
        Laya.stage.addChild(t);
      }),
      (t.prototype.onLoadHomeInfoListener = function (e) {
        var t,
          i = e.name,
          a = (e.ss, i.indexOf("("));
        (t = a > 0 ? i.substr(0, a) : i),
          (this.label_cur_city.text = t),
          (Global.roleCity = e.name),
          (Global.siteType = e.type_id),
          (Global.roleCityId = e.id),
          this.isOldeVersion ||
            (1 == e.type_id || 6 == e.type_id
              ? ((this.image_yiguan_item.visible = !0),
                (this.btn_jishi_item.visible = !0),
                (this.btn_guangchang_item.visible = !0),
                (this.btn_yiguan.visible = !0),
                (this.btn_item_guanyi.visible = !0),
                (this.btn_item_guangchang.visible = !0),
                (this.btn_item_jishi.visible = !0),
                (this.btn_item_yiguan.visible = !0))
              : ((this.image_yiguan_item.visible = !1),
                (this.btn_jishi_item.visible = !1),
                (this.btn_guangchang_item.visible = !1),
                (this.btn_yiguan.visible = !1),
                (this.btn_item_guanyi.visible = !1),
                (this.btn_item_guangchang.visible = !1),
                (this.btn_item_jishi.visible = !1),
                (this.btn_item_yiguan.visible = !1)));
      }),
      (t.prototype.baseInfoListener = function (e) {
        if (!this.isOldeVersion) {
          var t = Utils.dealRole_Type(e.roleType);
          Utils.transform(e.sex, "roleSexType");
          (this.nickName.text = e.name),
            (this.silverLabel.text = 0 == e.silver ? "0" : e.silver),
            (this.goldLabel.text = 0 == e.gold ? "0" : e.gold),
            (this.hpBar.value = e.hp / e.maxHp),
            (this.mpBar.value = e.mp / e.maxMp),
            (this.label_dengji.text =
              Utils.dealTransAndLvl(e.roleType, e.lvl) + t),
            (this.label_tili.text = "体" + e.tlz),
            0 == e.tlzs
              ? ((this.label_tili.text = "体：" + e.tlz + "（开启）"),
                (this.label_tili.color = "#22f804"),
                (this.tlzVal = "0"))
              : ((this.label_tili.text = "体：" + e.tlz + "（关闭）"),
                (this.label_tili.color = "#cccccc"),
                (this.tlzVal = "1")),
            (Global.roleId = e.id),
            (Global.roleName = e.name),
            (Global.roleLvl = e.lvl),
            (Global.roleSex = e.sex),
            (Global.roleHp = e.hp),
            (Global.roleMp = e.mp),
            (Global.roleType = e.roleType),
            (Global.roleVip = e.vip),
            (Global.superHK = e.superHK),
            (Global.vipBag = e.vipBag),
            e.gold,
            Global.roleLvl > Global.roleDefuLv &&
              WebSocketService.send({ c: 1425, d: { pageNum: 0 } }),
            (Global.roleDefuLv = e.lvl),
            parseInt(e.lvl) >= 10 &&
              "三国新人" === e.name &&
              AXModifyNameDialog.shwoModifyView();
        }
      }),
      (t.prototype.onLoadDaBiPingActData = function (e) {}),
      (t.prototype.is24HourContain = function (e) {
        var t = !0;
        if (e < 0) {
          86400 + e < 0 && (t = !1);
        }
        return t;
      }),
      (t.prototype.onLoadNPCDialogData = function (e) {
        0 != e.code && ToastView.toastView(e.msg);
      }),
      (t.prototype.onLoadMySelfMoney = function (e) {
        if (0 == e.code) {
          var t = e.data;
          0 == t.money && (t.money = "0"),
            0 == t.gold && (t.gold = "0"),
            (this.silverLabel.text = t.money),
            (this.goldLabel.text = t.gold);
        }
      }),
      (t.prototype.onLoadGroupTeamDataFn = function (e) {
        0 == e.code &&
          Laya.stage.event("ChatRoomView", {
            name: "group_team",
            data: e.data,
          });
      }),
      (t.prototype.onDidClickTiLiZhiAction = function () {
        "0" == this.tlzVal ? (this.tlzVal = "1") : (this.tlzVal = "0"),
          WebSocketService.send({ c: 3062, d: { s: this.tlzVal } });
      }),
      (t.prototype.onDidClickHuoDongDaBiPingAction = function () {
        var e = ActivityHomePageView.showActHomePageView();
        (e.y = 70), Laya.stage.addChild(e);
      }),
      (t.prototype.onDidClickNpcTaskListOpenFn = function () {
        (this.npcTaskListView = NpcTaskListView.showNpcTaskListView()),
          (this.npcTaskListView.x = 5),
          (this.npcTaskListView.y = 120),
          Laya.stage.addChild(this.npcTaskListView);
      }),
      (t.prototype.onLoadUserTaoWaDataFn = function (e) {
        ToastView.toastView(e.msg);
      }),
      (t.prototype.onLoadNewRoleUseAction = function (e) {
        0 == e.code && ToastView.toastView(e.msg);
      }),
      (t.prototype.onLoadWeekNoticeData = function (e) {
        var t = e.data;
        Laya.stage.event("HomePageView", {
          code: "week_notice",
          weekNotice: t,
        });
      }),
      t
    );
  })(ui.GameMainUI);
